home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 22 / CU Amiga Magazine's Super CD-ROM 22 (1998)(EMAP Images)(GB)[!][issue 1998-05].iso / PowerPC / Programming / PPCsiod / SIOD / siod.doc < prev    next >
Text File  |  1993-10-01  |  57KB  |  1,496 lines

  1. Scheme In One Define.
  2.  
  3. The garbage collector, the name and other parts of this program are
  4.  
  5.  *                     COPYRIGHT (c) 1989 BY                              *
  6.  *      PARADIGM ASSOCIATES INCORPORATED, CAMBRIDGE, MASSACHUSETTS.       *
  7.  
  8. Conversion  to  full scheme standard, characters, vectors, ports, complex &
  9. rational numbers, and other major enhancments by
  10.  
  11.  *      Scaglione Ermanno, v. Pirinoli 16 IMPERIA P.M. 18100 ITALY        * 
  12.  
  13. Permission  to use, copy, modify, distribute and sell this software and its
  14. documentation  for  any purpose and without fee is hereby granted, provided
  15. that  the  above  copyright  notice appear in all copies and that both that
  16. copyright   notice   and   this  permission  notice  appear  in  supporting
  17. documentation,  and that the name of Paradigm Associates Inc not be used in
  18. advertising or publicity pertaining to distribution of the software without
  19. specific, written prior permission.
  20.  
  21. PARADIGM  DISCLAIMS  ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  22. ALL  IMPLIED  WARRANTIES  OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
  23. PARADIGM  BE  LIABLE  FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  24. ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
  25. IN  AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
  26. OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  27.  
  28.  
  29.  Siod  is  an  interpreter for the algoritmic language SCHEME; the standard
  30. followed  in  the  implementation  is  described  in  "TI  Scheme  Language
  31. Reference  Manual"  and  follows  the  "Revised  Revised Report on Scheme".
  32. Sorry  the  "Revised  3-rd  Report  on  Scheme"  is not available to me and
  33. therefore I can not update Siod.
  34.  
  35.  Siod  is  a  pure  interpreter and no compilation is performed, and so the
  36. evaluation,  especially  of  complex  procedures  is  very  slow even if it
  37. requires only a small amount of memory to run.  Siod checks always the type
  38. of  objects  before perform operation on them, the ispector allows the user
  39. to  examine  the  contents of the stack frame and the environment in effect
  40. when  an  error  or  a  breakpoint is entered and only a few procedures are
  41. implemented  via  macro, so errors can be easily individuated even if there
  42. isn't  a stack frame backtrace.  These features makes Siod an ideal tool to
  43. learn  Scheme  and functional programming.  There isn't an esplicit control
  44. of evaluation and therefore Siod requires a well dimensioned stack to work.
  45. On  AMIGA  an  abnormal  termination  error  is  performed in case of stack
  46. overflow.
  47.  
  48.  Other  major  problems on version 2.6:  Bignum isn't implemented, integers
  49. are stored in a C-long until they overflows and then they are automatically
  50. stored  in  a  C-double (numbers in siod are automatically stored in lowest
  51. type  that  can  contain them with the minimum loss of information).  There
  52. aren't  breakpoint  levels,  when an error occours the inspector is invoked
  53. and  then  a  reset is performed.  Continuation aren't handled in the rigth
  54. way  and  are implemented in term of the Common-LISP-like *throw and *catch
  55. procedures,  and  so  they  hasn't an unlimited extent as prescribed by the
  56. standard but are valid only inside the procedure invoked by call/cc.  Every
  57. reset  reinitializes  the  *catch  list  and  every  *throw deletes all the
  58. *catch's  that were set after the corrispondent one was.  Resets and errors
  59. can   be  intercepted  by  the  user  via  the  non-standard  call-on-reset
  60. procedure.     Currently    the    procedures    with-input-from-file   and
  61. with-output-to-file  are  implemented using this mechanism and therefore if
  62. you escape from the procedure using call/cc or *throw the file isn't closed
  63. and  the  current  input  or  output isn't restored until the next reset or
  64. error.   Siod  uses a fixed size heap and its performances depends on the C
  65. stack.
  66.  
  67.  Siod's  memory  unit  is  called  cons  and is 10 bytes long, every scheme
  68. object  is  contained  in a cons, and all the symbols with the same printed
  69. representation  refers to the same cons (are interned).  The number of cons
  70. available  to  Siod  cannot  be  changed  during the session due to a dirty
  71. mechanism  of  garbage  collection, heritage of the original Paradigm code.
  72. Siod  can  be  run  with  a  really  small  amount of memory to the cost of
  73. frequent garbage collecting.  The discipline of garbage collecting followed
  74. is  mark & sweep:  all the cons allocated are available in a singol heap to
  75. the  user;  no  compaction  is  performed  but  this  isn't  a  problem  on
  76. microcomputers.
  77.  
  78.  The options available to the user are:
  79.  
  80.         -h<number>   sets the number of cons in siod's
  81.                      fixed-size heap.
  82.                      Minimum 1000. Default 5000.
  83.         -o<number>   sets the number of buckets in siod's
  84.                      symbols hash table.
  85.                      Minimum 1. Default 100.
  86.         -f<number>   sets the number of buckets in siod's
  87.                      integers hash table.
  88.                      Minimum 1. Default 100.
  89.         -i<filename> a file to be loaded in the high-speed
  90.                      user-global-environment.
  91.         -q           quiet flag.
  92.         -s           small set of predefined functions.
  93.  
  94.  The  options  can be set also setting environment variables (using the DOS
  95. command setenv):
  96.  
  97. SIOD-HEAP-SIZE  is equivalent to the -h option
  98. SIOD-SYMTAB-SIZE  is equivalent to the -o option
  99. SIOD-FIXTAB-SIZE  is equivalent to the -f option
  100. SIOD-INIT-FILE  is equivalent to the -i option
  101. SIOD-QUIET  if set to 1 is equivalent to the -q option
  102. SIOD-SMALL  if set to 1 is equivalent to the -s option
  103.  
  104.  Options  settled  using  environment  variables are overrun by the options
  105. specified in the command string.
  106.  
  107.  Symbols  with  the  same  printed  representation  are  stored at the same
  108. address  using  a  hash table (symtab), the user-global-environment isn't a
  109. proper environment but refers directly to the symbols contained in the hash
  110. table,  for  this  reason  its  bindings cannot be showed even if it can be
  111. accessed  by  the  procedures  like eval or load.  Provided there is a well
  112. dimensioned  hash  table,  loading  or defining procedures directly in this
  113. environment  can  increase greatly the speed of evaluation depending on the
  114. number of procedures defined in the user-initial-environment.
  115.  
  116.   The  only  difference between integers and other numbers is that integers
  117. are  interned,  so  two identical integers refers to the same heap cell and
  118. therefore  can be compared using eq?.  This way each integer is stored only
  119. once  saving  memory.   Also  identical  characters  are stored at the same
  120. address  using  hash  tables.  The table for characters has 256 buckets and
  121. can  contain all the characters of the extended ASCII code, therefore there
  122. isn't any collision.  The size of the symtab and fixtab can be specified by
  123. the  user;  collisions are handled with the chaining tecnique:  symbols and
  124. integers  hashed  to the same bucket are stored into a linear list.  Tables
  125. too  small  can reduce greately the speed of evaluation.  The procedure eq?
  126. used  to  determine  if two objects are identical, gives always the correct
  127. answer for interned objects.  Uninterned objects can be compared using eqv?
  128. or  equal?.   NOTE:   integers  that  overflows the size of a C-long aren't
  129. interned  and  cannot be compared with eq?  even if the integer?  predicate
  130. returns true.
  131.  
  132.  The behaviour of the interpreter during the session is determined by three
  133. variables that can be freely modified by the user:
  134.    siod-debug-mode if set to #t cause the inspector to be invoked after an
  135.                    error; if set to #f a reset is performed.
  136.    siod-repl-mode  if set to #t cause the interpreter to print after the
  137.                    evaluation of each command some information about the
  138.                    memory usage and time needed else only the prompt is
  139.                    printed.
  140.    siod-gc-mode    if set to #t before and after each garbage collection the
  141.                    interpreter prints a message showing also the time needed
  142.                    and the number of cells collected.
  143. If  siod is started with the -q option these three variables are set to #f
  144. otherwise to #t.
  145.  
  146.  If  siod  is  started with the -s option only a small number of predefined
  147. symbols are defined, and variables such nil true are not defined.  This can
  148. be useful to run siod with a small number of cons (i.e.  1500) to use it as
  149. a powerful calculator.
  150.  
  151.  On  AMIGA  the main program requires about 150k of mem and each cons is 10
  152. bytes  long; run siod with -h10000 -o1000 -f500 will require less than 280k
  153. and  works  fine on an old A500 not expanded leaving enough memory to run a
  154. good  editor in background.  Vectors and strings requires additional memory
  155. and  the  big  stack  size  needed  must  be  considered too.  The smallest
  156. configuration  -h1000  -o1 -f1 requires less than 180k to run.  A suggested
  157. configuration  is:   stack  size  50000, heap size 25000-50000, symtab size
  158. 1000-2000,  fixtab  size  500-5000  (depending  on  the  character  of  the
  159. application to be run).
  160.  
  161.  When  siod  is  started  with  full-set  option  it  looks  in the current
  162. directory    for    the    file    "siod.scm"   and   loads   it   in   the
  163. user-global-environment,  then,  if  specified,  loads the init file; if is
  164. started  with  the  small-set  option  loads  only the init file.  The file
  165. "siod.scm"  should  not  be  loaded  in  small-set mode because it requires
  166. procedures  not defined in that mode, the file small-siod.scm can be loaded
  167. or specifiead as init file, providing some useful definition.
  168.  
  169.  Part  of  the runtime library is defined in separate files that are loaded
  170. only  if necessary.  Siod looks for this files in the SIOD:  directory that
  171. should  be  correctly  assigned.  This path can be changed editing the file
  172. siod.scm  and  changing  the definition of the variable "path" in the first
  173. line  this  variable  is used only inside the file siod.scm and then can be
  174. redefined.
  175.  
  176. LANGUAGE DEFINITION
  177.  
  178. x any scheme object
  179. n any number
  180. r a rational number
  181. m a complex number
  182. i an integer
  183. o a procedure
  184. p a port
  185. s a string
  186. c a character
  187. y a symbol
  188. e an environment
  189. l a list or a pair
  190. v a vector
  191.  
  192. {x} an optional argument
  193. x ... a list of argument
  194. x1 the first arg in the arg-list
  195.  ....
  196. xn the n-th arg in the arg-list
  197.  
  198. <exp> any scheme expression
  199. <pred> a scheme expression that returns #t or #f
  200.  
  201. NOTES: constants should not be modified, <exp> is identical to x the use of
  202. one or the other indicates the tipical use in that context. Optional
  203. arguments of subroutines of types 1 2 3 can be replaced by nil (non
  204. standard), basic subroutines are defined also in -s mode, subroutine are
  205. available only in full mode, the other are defined in the file siod.scm
  206. directly or as autoload-from-file.
  207.  
  208. #\backspace (defined in siod.scm)
  209.                 constant.
  210. #\escape (defined in siod.scm)
  211.                 constant.
  212. #\newline (defined in siod.scm)
  213.                 constant.
  214. #\page (defined in siod.scm)
  215.                 constant.
  216. #\return (defined in siod.scm)
  217.                 constant.
  218. #\rubout (defined in siod.scm)
  219.                 constant.
  220. #\space (defined in siod.scm)
  221.                 constant.
  222. #\tab (defined in siod.scm)
  223.                 constant.
  224. * (basic subroutine)
  225.         (* n ... )
  226.                 multiplies a list of numbers.
  227. *the-non-printing-object* (constant)
  228.     *the-non-printing-object*
  229.         This is a value that if intercected by the standard
  230.         scheme-top-level cause it not to print nothing.
  231. + (basic subroutine)
  232.         (+ n ... )
  233.                 adds a list of numbers.
  234. - (basic subroutine)
  235.         (- n ... )
  236.                 subtracts a list of numbers.
  237. -1+ (basic subroutine)
  238.         (-1+ n)
  239.                 subtracts 1 from n. Is faster than (- n 1).
  240. / (basic subroutine)
  241.         (/ n ... )
  242.                 divides a list of numbers.
  243. 1+ (basic subroutine)
  244.         (1+ n)
  245.                 adds 1 to n. Is faster than (+ n 1).
  246. < <= <> = > >= (basic subroutine)
  247.         (op n n)
  248.                 compares two numbers.
  249. abs (basic subroutine)
  250.         (abs n)
  251.                 returns the absolute value of a number.
  252. access (subroutine)
  253.     (access y {e})
  254.         returns the value of a symbol in an environment. If no
  255.                 environment is specified the current environment is used.
  256. acos (basic subroutine)
  257.         (acos n)
  258.                 returns the arcosine of a number.
  259. add1 (subroutine)
  260.         (add1 n)
  261.         adds 1 to its argument.
  262. alias (defined in siod.scm)
  263.     (alias y1 y2)
  264.         It is a macro that allows the symbol y1 to be used instead
  265.                 of y2 in every contest.
  266. and (basic subroutine)
  267.     (and <exp> ... )
  268.         Performs the logical and of a list of expressions. It
  269.                 evaluates the expressions until they evaluates to #t and
  270.                 returns the value returned by the last exp or #f.
  271. append (basic subroutine)
  272.     (append l ... )
  273.         Return the list obtained concatenating its arguments.
  274. append! (subroutine)
  275.     (append! l ... )
  276.         Return the list obtained destructively concatenating its 
  277.         arguments.
  278. apply (subroutine)
  279.     (apply o l)
  280.         Evaluates the procedure o with the arguments of l.
  281. apply-if (subroutine)
  282.     (apply-if <pred> o x)
  283.         Evaluates <pred> and if it returns a non-null value
  284.         evaluates the procedure o with the result of <preed> as
  285.         argument. If <pred> is #f returns x.
  286. ascii->symbol (subroutine)
  287.     (ascii->symbol i)
  288.         Return an interned symbol whose printed representation is
  289.                 the character of ASCII code i.
  290. asin (basic subroutine)
  291.         (asin n)
  292.                 returns the arcosine of a number.
  293. assert (defined in siod.scm)
  294.     (assert <pred> x ... )
  295.         Conditionally enters a breakpoint. If <pred> is #f prints
  296.         every x and enters a breakpoint.
  297. assoc assq assv (subroutine)
  298.     (op x l)
  299.         Returns the first pair in a list of pairs whose car
  300.                 component matches x. Assco uses equal? for comparison, assq
  301.         uses eq? and assv eqv?.
  302. atan (basic subroutine)
  303.         (atan n)
  304.                 returns the arcotangent of a number.
  305. atom? (basic subroutine)
  306.     (atom? x)
  307.         returns # if its arg is an atom (not a pair).
  308. autoload-from-file (subroutine)
  309.     (autoload-from-file s l {e})
  310.         s is a string that names a file and l a list of variables.
  311.         autoload-from-file loads the file s in the environment e
  312.         the first time one of the variables contained in l is
  313.         referenced. If e is omitted the file is loaded in the
  314.         current environment.
  315. begin (basic subroutine)
  316.     (begin <exp> ... )
  317.         Begin evaluates in sequence a list of expressions returning
  318.         the value of the last <exp>.
  319. begin0 (subroutine)
  320.     (begin0 <exp> ... )
  321.         Begin0 evaluates in sequence a list of expressions returning
  322.         the value of the first <exp>.
  323. boolean? (defined in siod.scm)
  324.     (boolean? x)
  325.         Checks if its arg is #t or #f.
  326. c....r (defined in siod.scm as autoload-from-file)
  327.     (c....r l)
  328.         Performs a serie of car and cdr on a list. the .... can be
  329.         any combination of the letters a and d, up to 4 characters,
  330.         the a indicates a car and the d a cdr.
  331. call-with-current-continuation (defined in siod.scm)
  332.     (call-with-current-continuation o)
  333.         o is a procedure of one argument. call/cc calls this
  334.         procedure passing it a procedure of one argument that
  335.         represent the future of evaluation at the moment call/cc
  336.         was evaluated. When this procedure is invoked its argument
  337.         is returned as result of call/cc. In Siod continuations are
  338.         valid only inside the procedure invoked by call/cc.
  339. call-with-input-file call-with-output-file 
  340.     (defined in siod.scm as autoload-from-file)
  341.     (op s o)
  342.         o is a procedure of one argument, it opens the file
  343.         specified by the string s (the first opens an input file
  344.         and the second an output file), and then invokes o passing
  345.         it the file as argument. If o returns the file is closed.
  346. call/cc (defined in siod.scm)
  347.     (call/cc o)
  348.         Another name for call-with-current-continuation.
  349. car (basic subroutine)
  350.     (car l)
  351.         Returns the car component of a pair.
  352. case (subroutine)
  353.     (case <exp1>
  354.               (x <exp2> ...)
  355.                  .....
  356.               {(else <exp3> ...)})
  357.         Case evaluates <exp1> an then compares the result with the
  358.         x's until the comparison is #t, or finds the keyword else.
  359.         The comparison is perfomed using eqv? if the x is an atom 
  360.         and using memv? if is a pair. When the matching clause is
  361.         found the exp's are evaluated in sequence and the value of
  362.         the last exp returned as result of case.
  363. cdr (basic subroutine)
  364.     (cdr l)
  365.         Returns the cdr component of a pair.
  366. ceiling (basic subroutine)
  367.     (ceiling n)
  368.         Returns the smallest integer greater than or equal to n.
  369. char->integer (basic subroutine)
  370.     (char->integer c)
  371.         Return the ascii code corrispondent to the character c.
  372. char-ci<=? char-ci<? char-ci=? char-ci>=? char-ci>? 
  373.     (defined in siod.scm as autoload-from-file)
  374.     (op c c)
  375.         compares two characters in a case insensitive way.
  376. char-downcase char-upcase (subroutine)
  377.     (op c)
  378.         Forces a caracter to lowercase or uppercase.
  379. char<=? char<? char=? char>=? char>?
  380.     (defined in siod.scm as autoload-from-file)
  381.     (op c c)
  382.         compares two characters.
  383. char? (basic subroutine)
  384.     (char? x)
  385.         Checks if its arg is a character.
  386. close-input-port close-output-port (subroutine)
  387.     (op p)
  388.         Close a port.
  389. closure? (subroutine)
  390.     (closure? o)
  391.         Checks if its arg is a closure (lambda named-lambda or
  392.         fluid-lambda).
  393. complex (basic subroutine)
  394.     (complex n)
  395.         Forces a number to complex.
  396. complex? (basic subroutine)
  397.     (complex? x)
  398.         Checks if its arg is a complex number.
  399. cond (basic subroutine)
  400.     (cond (<pred> <exp1> ... )
  401.                     .....
  402.               {(else <exp2> ... )})
  403.         Evaluates the pred's until one evaluates to #t or it finds
  404.         the keyword else, then the corrispondent exp's are
  405.         evaluated in sequence and the value of the last exp 
  406.         returned.
  407. cons (basic subroutine)
  408.     (cons x1 x2)
  409.         Creates a new pair with x1 as car and x2 as cdr.
  410. cons-stream (defined in siod.scm as autoload-from-file)
  411.     (cons-stream x1 x2)
  412.         Creates a stream with x1 as head and x2 as tail. x2 isn't
  413.         evaluated.
  414. copy (subroutine)
  415.     (copy l)
  416.         Creates a copy of an entire tree of pairs.
  417. cos (basic subroutine)
  418.         (cos n)
  419.                 returns the cosine of a number.
  420. current-input-port current-output-port 
  421.     (defined in siod.scm as autoload-from-file)
  422.     (op)
  423.         Returns respectively the current input or output port.
  424. define (basic subroutine)
  425.     (define y)
  426.     (define y <exp>)
  427.         (define spec <exp> ... )
  428.                 spec: (y1 y2 ... {. y3}) | (spec y4 y5 ... {. y6})
  429.         The first form defines a variable in the current
  430.         environment frame without initialize it. The second first
  431.         evaluates the exp and then defines a variable in the 
  432.         current environment frame initializing it with the value
  433.         returned by exp. The third is an abbreviated form to define
  434.         procedures. 
  435.         (define (y1 y2 ...) <exp>) is equivalent to:
  436.                 (define y1 (lambda (y2 ...) <exp>) and
  437.                 (define (((y1) y2) y3) <exp>) is equivalent to:
  438.                 (define y1 (lambda () (lambda (y2) (lambda (y3) <exp>)))).
  439. delay (defined in siod.scm as autoload-from-file)
  440.     (delay <exp>)
  441.         Creates a delayed object. exp isn't evaluated. The object
  442.         is memoized.
  443. delayed-object? (defined in siod.scm as autoload-from-file)
  444.     (delayed-object? x)
  445.         Checks if itsarg is a delayed object.
  446. delete! delq! (subroutine)
  447.     (op x l)
  448.         Destructively eliminates all the occurrences of x in l.
  449.         The first uses equal? for comparison, the second eq?.
  450. denominator (basic subroutine)
  451.     (denominator r)
  452.         Returns the denominator of a rational number.
  453. display (basic subroutine)
  454.     (display x {p})
  455.         Prints x to a port. Strings are not enclosed in ", symbols
  456.         are not slashified, characters are not preceeded by #\.
  457. do (basic subroutine)
  458.     (do ((y1 <exp1> <exp2>)
  459.                  ....   )
  460.             (<pred> <exp3> ...)
  461.             <exp4> ...)
  462.         Provides an iteration capability. First extends the
  463.         environment with all the y1 bound to the exp1, then
  464.         evaluates pred, if it is #f evaluates exp4 and the other
  465.         expressions and then evaluates all the exp2 and in a second
  466.         time binds the result to the corrispondent y1. After this
  467.         evaluates back pred and repeats the process until pred
  468.         evaluates #t at this point evaluates exp3 and the other
  469.         expressions returning the value of the last.
  470. dos-call (basic subroutine)
  471.     (dos-call s)
  472.         Passes a string to the DOS.
  473. empty-stream? (defined in siod.scm as autoload-from-file)
  474.     (empty-stream? x)
  475.         Checks if its arg is an empty-stream.
  476. environment-bindings (basic subroutine)
  477.     (environment-bindings e)
  478.         Returns the bindings of an environment. The bindings should
  479.         not be modified. 
  480. environment-parent (basic subroutine)
  481.     (environment-parent e)
  482.         Returns the parent of an environment. 
  483. environment? (basic subroutine)
  484.     (environment? x)
  485.         Checks if its arg is an environment.
  486. eof-object? (basic subroutine)
  487.     (eof-object? x)
  488.         Checks if its arg is an eof marker. Is the only way to
  489.         identify an eof.
  490. eq? (basic subroutine)
  491.     (eq? x1 x2)
  492.         Checks if x1 is identical to x2.
  493. equal? (basic subroutine)
  494.     (equal? x1 x2)
  495.         Checks if x1 is equivalent to x2 verifing eventually all
  496.         the components of lists and vectors.
  497. eqv? (basic subroutine)
  498.     (eqv? x1 x2)
  499.         Checks if x1 is equivalent to x2 where x1 and x2 are
  500.         non-pairs and non-vectors.
  501. error (basic subroutine)
  502.     (error s x ...)
  503.         Cause an error of message s and sets errobj to the list of
  504.         x's.
  505. eval (basic subroutine)
  506.     (eval <exp> {e})
  507.         Evaluates an expression in an environment. If e is omitted
  508.         the current environment is used instead.
  509. even? (subroutine)
  510.     (even? i)
  511.         Checks if its arg is an even integer.
  512. exit (subroutine)
  513.     (exit)
  514.         Exits Siod.
  515. exp (basic subroutine)
  516.         (exp n)
  517.                 returns e^n (e is the Eulero number).
  518. explode (defined in siod.scm as autoload-from-file)
  519.     (explode i)
  520.     (explode s)
  521.     (explode y)
  522.         Returns a list of one character symbols corresponding to
  523.         the characters of the printed representation of its
  524.         argument. 
  525. expt (basic subroutine)
  526.     (expt n1 n2)
  527.         Returns n1 powered to n2.
  528. f (constant)
  529.     f
  530.         initialized to #f
  531. false (constant)
  532.     false
  533.         initialized to #f
  534. file-exists? (subroutine)
  535.     (file-exists? s)
  536.         Checks if exists a file named s.
  537. file-length (defined in siod.scm as autoload-from-file)
  538.     (file-length s)
  539.         Returns the length in bytes of the file named s.
  540. float (basic subroutine)
  541.     (float n)
  542.         Forces a number to float.
  543. float? (basic subroutine)
  544.     (float? x)
  545.         Checks if its arg is a float number.
  546. floor (basic subroutine)
  547.     (floor n)
  548.         Return the largest integer not greater than n.
  549. fluid (subroutine)
  550.     (fluid y)
  551.         Access a symbol in the fluid environment.
  552. fluid-bound? (subroutine)
  553.     (fluid-bound? y)
  554.         Returns #t if y is bound in the fluid environment.
  555. fluid-lambda (subroutine)
  556.     (fluid-lambda ({y1 ...} {. y2}) <exp> ...)
  557.         Returns a closures whose arguments will be bound in the
  558.         fluid environment. If y2 is specified all the arguments
  559.         passed to the closure that exceed the number of arguments
  560.         needed are bound to y2 in a list.
  561. fluid-let (subroutine)
  562.     (fluid-let ((y1 <exp1>)
  563.                        ....   )
  564.                    <exp2> ... )
  565.         evaluates all the <exp1>, binds the results to the
  566.         correspondent y in the fluid environment and then evaluates
  567.         all the exp2 returning the value of the last exp.
  568. flush-input (subroutine)
  569.     (flush-input {p})
  570.         clears an input port's buffer. If p is not specified the
  571.         current input port is used instead.
  572. for-each (subroutine)
  573.     (for-each o l)
  574.         o is a procedure of one argument. For-each applyes o to all
  575.         the elements of l from left to rigth.
  576. force (defined in siod.scm as autoload-from-file)
  577.     (force x)
  578.         Forces the evaluation of a delayed object. If the object
  579.         has been forced previously the previous result is returned.
  580. freesp (basic subroutine)
  581.     (freesp)
  582.         Returns the number of bytes available.
  583. freeze (defined in siod.scm as autoload-from-file)
  584.     (freeze <exp>)
  585.         Return a thunk. <exp> isn't evaluated and not memoized.
  586. gc (basic subroutine)
  587.     (gc)
  588.         Forces a garbage collection.
  589. gcd (basic subroutine)
  590.     (gcd i ...)
  591.         Returns the greatest common divisor of a list of integers.
  592. gensym (subroutine)
  593.     (gensym)
  594.     (gensym i)
  595.     (gensym s)
  596.         Generates a new uninterned symbol. The symbol is generated
  597.         from a string and a counter if the arg is a string it
  598.         replaces the current string, if it is an integer resets the
  599.         counter.
  600. get-file-position (subroutine)
  601.     (get-file-position p)
  602.         Returns the value of the file pointer associated to p.
  603. getprop (subroutine)
  604.     (getprop y1 y2)
  605.         Looks for the property y2 in the proplist of y1.
  606. head (defined in siod.scm as autoload-from-file)
  607.     (head stream)
  608.         Returns the head component of a stream.
  609. if (basic subroutine)
  610.     (if <pred> <exp1> <exp2>)
  611.         Evaluates pred, if pred is #t evaluates exp1 else exp2.
  612. imaginary (basic subroutine)
  613.     (imaginary m)
  614.         (returns the imaginary part of a complex number.
  615. implode (defined in siod.scm as autoload-from-file)
  616.     (implode l)
  617.         l is a list composed by numbers, symbols or strings.
  618.         Implode creates a symbol composed by the first character of
  619.         the printed representation of strings and symbols or from
  620.         the character of ASCII code correspondent to the integers 
  621.         contained in the list.
  622. input-port (fluid variable)
  623.     (fluid input-port)
  624.         Contains the default port used by the i/o routines. Must
  625.         evaluate to a port or a fatal error occours.
  626. input-port? (subroutine)
  627.     (input-port? x)
  628.         Checks if its arg is an input port.
  629. inspect (basic subroutine)
  630.     (inspect {e})
  631.         The default inspector invoked after an error or in a
  632.         breakpoint.
  633. integer->char (basic subroutine)
  634.     (integer->char i)
  635.         Returns a character of ASCII code i.
  636. integer->string (subroutine)
  637.     (integer->string i1 i2)
  638.         Returns a string containing the written representation of
  639.         i1 expressed in base i2.
  640. integer? (basic subroutine)
  641.     (integer? x)
  642.         Checks if its arg is an integer.
  643. lambda (basic subroutine)
  644.     (lambda ({y1 ...} {. y2}) <exp> ...)
  645.         Creates a new closure of arguments y's and body exp's. If
  646.         y2 is specified all the arguments exeeding the number of
  647.         args needed are linked together in a list and bound to y2.
  648. last-pair (subroutine)
  649.     (last-pair l)
  650.         Returns the last pair of a list.
  651. lcm (basic subroutine)
  652.     (lcm i ...)
  653.         Returns the lowest common multiplier of a list of integers.
  654. length (subroutine)
  655.     (length l)
  656.         Returns the length of a list.
  657. let (basic subroutine)
  658.     (let ((y <exp1>)
  659.                .....    )
  660.              <exp2> ...  )
  661.         Evaluates all the exp's and then extends the environment
  662.         binding each y with the result of the corresponding exp
  663.         then evaluates all the exp2 and returns the value of the
  664.         last exp.
  665. let* (subroutine)
  666.     (let* ((y1 <exp1>)
  667.                   ....    )
  668.               <exp2> ...   )
  669.         Evaluates the first exp then extends the environment
  670.         binding the result to the firs symbol, then evaluates in
  671.         the extended environment the second symbol extending again
  672.         the environment with the new binding, repeat thi for all
  673.         the symbols and exp, then evaluates exp2 and the other exp
  674.         returning yhe value of the last exp.
  675. letrec (subroutine)
  676.     (letrec ((y1 <exp1>)
  677.                     ....    )
  678.                 <exp2> ...   )
  679.         Extends the environment with all the ys, then evaluates all
  680.         the exp in the extended environment and binds each y with 
  681.         the result of the corresponding exp, then evaluates exp2
  682.         and the other exp returning the value of the last exp.
  683. list (basic subroutine)
  684.     (list x ...)
  685.         Returns a list composed of all its arguments.
  686. list* (subroutine)
  687.     (list x ...)
  688.         Returns a dot-list (not nil terminated) composed of all its
  689.                 arguments.
  690. list->stream (defined in siod.scm as autoload-from-file)
  691.     (list->stream l)
  692.         Returns a stream containing the elements of l.
  693. list->string (subroutine)
  694.     (list->string l)
  695.         l is a list of characters. Retuns a string composed by the
  696.         characters contained in l.
  697. list->vector (subroutine)
  698.     (list->vector l)
  699.         Returns a vector containing the same elements of l.
  700. list-ref (subroutine)
  701.     (list-ref l n)
  702.         Returns the n-th elements of l.
  703. list-tail (subroutine)
  704.     (list-tail l n)
  705.         Returns the n-th pair of a list.
  706. load (basic subroutine)
  707.     (load s {e})
  708.         Loads a file named s evaluating its expression in e. If e
  709.         is not specified the current environment is used insead.
  710.         The optional environment is not standard.
  711. log (basic subroutine)
  712.         (log n1 {n2})
  713.                 returns the logarithm of n1 in base n2. If n2 is omitted
  714.                 the natural logarithm is returned.
  715. macro (basic subroutine)
  716.     (macro y o)
  717.         o is a procedure of one argument. Defines in the current
  718.         environment y bound to a macro. When the macro is evaluated
  719.         the current expression is passed to o and the result is
  720.         evaluated instead. 
  721. macro? (basic subroutine)
  722.     (macro? y)
  723.         Checks if its arg is a macro.
  724. make-complex (basic subroutine)
  725.     (make-complex n1 n2)
  726.         Creates a new complex number with n1 as real part and n2 as
  727.         imaginary part.
  728. make-environment (defined in siod.scm)
  729.     (make-environment <exp> ...)
  730.         Creates a new environment, evaluates in it all the exp's
  731.         and returns it.
  732. make-rational (basic subroutine)
  733.     (make-rational n1 n2)
  734.         Creates a new rational number with n1 as numerator and n2
  735.         as denominator.
  736. make-string (subroutine)
  737.     (make-string i {c})
  738.         Creates a string composed by i occurrence of c or of blanks
  739.         if c is omitted.
  740. make-vector (subroutine)
  741.     (make-vector i {x})
  742.         Creates a vector composed by i occurrences of x or nil of x
  743.         is omitted.
  744. map (basic subroutine)
  745.     (map o l)
  746.         o is a procedure of one argument. Map applyes o to every
  747.         element of l returning a list of the results.
  748. mapc (subroutine)
  749.     (mapc o l)
  750.         The same as for-each.
  751. mapcar (subroutine)
  752.     (mapcar o l)
  753.         The same as map.
  754. max (basic subroutine)
  755.     (max n ... )
  756.         Returns the greatest of a list of numbers.
  757. member memq memv (subroutine)
  758.     (op x l)
  759.         Returns the sublist beginning with the first occurrece of x
  760.         in l. Member uses equal? for comparison, memq eq? memv
  761.         eqv?.
  762. min (basic subroutine)
  763.     (min n ... )
  764.         Return the smallest of a list of numbers.
  765. minus (subroutine)
  766.         (minus n)
  767.                 returns the opposite of a number.
  768. modulo (basic subroutine)
  769.     (modulo i1 i2)
  770.         Returns the remainder of i1/i2 with the sign of i2.
  771. named-lambda (subroutine)
  772.     (named-lambda (y1 {y2 ...} {. y3}) <exp> ...)
  773.         Creates a new closure of arguments y2 ... and body exp's.
  774.         When it's evaluated the procedure is bound to its name
  775.         allowing recusion and relatively faster speed of execution.
  776.         If y3 is specified all the arguments exeeding the number of
  777.         args needed are linked together in a list and bound to y3.
  778. negative? (subroutine)
  779.     (negative? n)
  780.         Checks if its arg is a negative number.
  781. newline (defined in siod.scm as autoload-from-file)
  782.     (newline {p})
  783.         Prints a newline on a port. If p is omitted the current
  784.         output port is used instead.
  785. nil (constant)
  786.         initialized to #f.
  787. not (subroutine)
  788.     (not <exp>)
  789.         Logically negates an expression.
  790. null? (basic subroutine)
  791.     (null? x)
  792.         Checks if its arg is the empty list.
  793. number->string (subroutine)
  794.     (number->string n l)
  795.         Return a string containing the written representation of n.
  796.         l is a list specifing the format of n. Format allowed are:
  797.         (int) express n as integer
  798.         (heur) express n heuristically.
  799. number? (basic subroutine)
  800.     (number? x)
  801.         Checks if its arg is a number.
  802. numerator (basic subroutine)
  803.     (numerator r)
  804.         Returns the numerator part of a rational number.
  805. odd? (subroutine)
  806.     (odd? i)
  807.         Checks if its arg is an odd integer.
  808. open-binary-input-file open-binary-output-file 
  809.     (defined in siod.scm as autoload-from-file)
  810.     (op s)
  811.         Returns a port bound to a binary file of name s. If the
  812.         file does not exists is created, if exists
  813.         open-binary-output-file overwrites it.
  814. open-extend-file open-input-file open-output-file 
  815.     (defined in siod.scm as autoload-from-file)
  816.     (op s)
  817.         Returns a port bound to a file named s. If the file does
  818.         not exists is created, if does not exists open-extend-file
  819.         append the output to the end of file, open-output-file
  820.         overwrites it.
  821. or (basic subroutine)
  822.     (or <exp> ...)
  823.         Performs a logical or between the exps. Evaluates the exp
  824.         until they evaluates to #f and returns the value of the
  825.         first exp that doesn't evaluates to #f or #f.
  826. output-port (fluid variable)
  827.     (fluid output-port)
  828.         Contains the default port used by the i/o routines. Must
  829.         evaluate to a port or a fatal error occours.
  830. output-port? (subroutine)
  831.     (output-port? x)
  832.         Checks if its arg is an output port.
  833. page (defined in siod.scm as autoload-from-file)
  834.     (page {p})
  835.         Prints a linefeed to a port if p is omitted the current
  836.         output port is used instead.
  837. pair? (subroutine)
  838.     (pair? x)
  839.         Checks if its arg is a pair.
  840. pi (constant)
  841.         The ratio of a circumference to its diameter.
  842. port? (basic subroutine)
  843.     (port? x)
  844.         Checks if its arg is a port.
  845. positive? (subroutine)
  846.     (positive? n)
  847.         Returns #t if its arg is greater than or equal to 0.
  848. prin1 (subroutine)
  849.     (prin1 x {p})
  850.         The same as write.
  851. princ (subroutine)
  852.     (princ x {p})
  853.         The same as display.
  854. print (basic subroutine)
  855.     (print x {p})
  856.         Prints x to a port on a new line using write.
  857. print-length (subroutine)
  858.     (print-length x1 {x2})
  859.         Calculates the number of characters needed to print x1
  860.         using display. If x2 is specified and evaluates to #t uses
  861.         write instead. x2 is not standard.
  862. proc? (basic subroutine)
  863.     (procedure? x)
  864.         Checks if its arg is a subroutine, a special form or a
  865.         closure.
  866. procedure-environment (subroutine)
  867.     (procedure-environment o)
  868.         Returns the environment where o was defined.
  869. procedure? (subroutine)
  870.     (procedure? x)
  871.         Checks if its arg is a subroutine or a special form.
  872. proplist (subroutine)
  873.     (proplist y)
  874.         Returns the property-list associated to y.
  875. putprop (subroutine)
  876.     (putprop y1 x y2)
  877.         Adds the prop y2 to the proplist of y1 with the value of x.
  878. quasiquote (subroutine)
  879.     (quasiquote x)
  880.     `x
  881.         Returns its arg unevaluated eventually evaluating the
  882.         special forms , ,@ ,. unquote unquote-splicing contained in
  883.         it. (unquote x) or ,x cause the x to be evaluated and
  884.         inserted in the list instead of it. The arg of
  885.         (unquote-splicing l) or ,@l must be a list and cause the
  886.         elements of the list replace it without parenthesis. With
  887.         ,.l the splicing is destructive. Unquoting happens only at
  888.         the first level of quasiquoting.
  889. quote (basic subroutine)
  890.     (quote x)
  891.     'x
  892.         Returns its argument unevaluated.
  893. quotient (basic subroutine)
  894.     (quotient i1 i2)
  895.         Returns the quotient of i1/i2.
  896. random (basic subroutine)
  897.     (random i)
  898.         Returns a random number between 0 and i-1.
  899. randomize (basic subroutine)
  900.     (randomize i)
  901.         Start a new series of random numbers. If i is 0 the timer
  902.         is used as seed.
  903. rational (basic subroutine)
  904.     (rational n)
  905.         Forces a number to rational.
  906. rational? (basic subroutine)
  907.     (rational? x)
  908.         Checks if its arg is a rational number.
  909. read (basic subroutine)
  910.     (read {p})
  911.         Reads a scheme expression from a port. If p is omitted the
  912.         current port is used instead.
  913. read-char (subroutine)
  914.     (read-char {p})
  915.         Reads a character from a port. If p is omitted the current 
  916.         port is used instead.
  917. read-line (subroutine)
  918.     (read-line {p})
  919.         Returns a string containing a line read from a port. If p is
  920.         omitted the current port is used instead.
  921. real (basic subroutine)
  922.     (real m)
  923.         Returns the real part of a complex number.
  924. real? (subroutine)
  925.     (real? x)
  926.         Checks if its arg is a real number (integer rational or
  927.         float).
  928. rec (defined in siod.scm)
  929.     (rec y <exp>)
  930.         Extend the environment binding y to exp and then evaluates
  931.         exp and return it value.
  932. remainder (basic subroutine)
  933.     (remainder i1 i2)
  934.         Returns the remainder of i1/i2 with the sign of i1.
  935. remprop (subroutine)
  936.     (remprop y1 y2)
  937.         Removes The property y2 from the proplist of y1.
  938. reset (subroutine)
  939.     (reset)
  940.         aborts evaluation restarting the current scheme-top-level
  941.         loop.
  942. reset-scheme-top-level (subroutine)
  943.     (reset-scheme-top-level)
  944.         Binds the fluid variable scheme-top-level to the default
  945.         read-eval-print loop without starting it.
  946. reverse (basic subroutine)
  947.     (reverse l)
  948.         Returns a list containing the same elements of l in reverse
  949.         order.
  950. reverse! (subroutine)
  951.     (reverse l)
  952.         Destructively returns a list containing the same elements
  953.         of l in reverse order.
  954. round (basic subroutine)
  955.     (round n)
  956.         Returns the integer closest to n.
  957. runtime (subroutine)
  958.     (runtime)
  959.         Returns the time of day expressed in milliseconds.
  960. scheme-reset (subroutine)
  961.     (scheme-reset)
  962.         Resets the fluid variable scheme-top-level to its default
  963.         value and the fluid variables input-port output-port to the
  964.         value of standard-input standard-output respectively. Then
  965.         restarts the execution. Resets also the inspector to the
  966.         default inspector and *error* to the default error handler.
  967. scheme-top-level (fluid variable)
  968.     (fluid scheme-top-level)
  969.         contains the corrent top-level read-eval-print loop. Can be
  970.         rebound by the user. If the procedure returns the system
  971.         invokes it again.
  972. sequence (subroutine)
  973.     (sequence <exp> ...)
  974.         The same as begin.
  975. set! (basic subroutine)
  976.     (set! y x)
  977.     (set! (fluid y) x)
  978.     (set! (vector-ref v i) x)
  979.     (set! (access y {e}) x)
  980.         The first form sets the binding of the symbol y in the
  981.         current environment to x.
  982.         The second sets the binding of the symbol y in the
  983.         fluid environment to x.
  984.         The third sets the i-th element of the vector v to x.
  985.         The fourth sets the binding of the symbol y in the
  986.         environment e to x. If e is omitted the current environment
  987.         is used instead.
  988. set-car! (basic subroutine)
  989.     (set-car! l x)
  990.         sets the car component of the pair l to x.
  991. set-cdr! (basic subroutine)
  992.     (set-cdr! l x)
  993.         sets the cdr component of the pair l to x.
  994. set-file-position! (subroutine)
  995.     (set-file-position! p i1 i2)
  996.         Positions the file pointer inside the file associated to p
  997.         if i2 is 0 sets the file position to i1 bytes from the
  998.         beginning of the file.
  999.         if i2 is 1 sets the file position to i1 bytes from the
  1000.         current position of the file.
  1001.         if i2 is 2 sets the file position to i1 bytes from the
  1002.         end of the file.
  1003. set-fluid! (subroutine)
  1004.     (set-fluid! y x)
  1005.         Sets the binding of y in the fluid environment to x.
  1006. sin (basic subroutine)
  1007.     (sin n)
  1008.         Returns the sin of a number.
  1009. sort! (defined in siod.scm as autoload-from-file)
  1010.     (sort! l)
  1011.     (sort! v)
  1012.         Destructively sorts a list or a vector. It uses quicksort
  1013.         for vectors and merge-sort for lists.
  1014. sqrt (basic subroutine)
  1015.     (sqrt n)
  1016.         Returns the square root of a number.
  1017. standard-input (variable)
  1018.     standard-input
  1019.         Contains the standard input. Is initialized to the console.
  1020.         Must evaluate to a port or a fatal error occours.
  1021. standard-output (variable)
  1022.     standard-output
  1023.         Contains the standard output. Is initialized to the console.
  1024.         Must evaluate to a port or a fatal error occours.
  1025. stream->list (defined in siod.scm as autoload-from-file)
  1026.     (stream->list stream)
  1027.         Converts a finite stream to a list.
  1028. stream? (defined in siod.scm as autoload-from-file)
  1029.     (stream? x)
  1030.         Checks if its arg is a stream.
  1031. string->list (subroutine)
  1032.     (string->list s)
  1033.         returns a list composed of the characters contained in s.
  1034. string->number (subroutine)
  1035.     (string->number s y1 y2)
  1036.         Converts a string to a number. y1 represent the exactness
  1037.         but it is not implemented on siod and then is ininfluent.
  1038.         y2 is the radix and can be:
  1039.         'b indicates that s represents a binary number
  1040.                 'd indicates that s represents a decimal number
  1041.                 'o indicates that s represents an octal number
  1042.                 'x indicates that s represents an hexadecimal number
  1043. string->symbol (subroutine)
  1044.     (string->symbol s)
  1045.         Returns a symbol of printed representation correspondent to
  1046.         the string s.
  1047. string->uninterned-symbol (subroutine)
  1048.     (string->uninterned-symbol s)
  1049.         Returns an uninterned symbol of printed representation 
  1050.         correspondent to the string s.
  1051. string-CI<? string-CI=? (defined in siod.scm as autoload-from-file)
  1052.     (op s1 s2)
  1053.         Compares two string in a case insensitive way.
  1054. string-append (basic subroutine)
  1055.     (string-append s ...)
  1056.         Returs the string obtained concatenating all its arg.
  1057. string-copy (subroutine)
  1058.     (string-copy s)
  1059.         Returns a new string identical to s.
  1060. string-fill! (subroutine)
  1061.     (string-fill! s {c})
  1062.         Replaces all the caracters in s with the character c. If c
  1063.         is omitted a blank is used.
  1064. string-length (basic subroutine)
  1065.     (string-length s)
  1066.         Returns the length of the string s.
  1067. string-null? (defined in siod.scm as autoload-from-file)
  1068.     (string-null? x)
  1069.         Checks if its arg is an empty string.
  1070. string-ref (basic subroutine)
  1071.     (string-ref s i)
  1072.         Returns the i-th character of the string s. The first
  1073.         character has index 0.
  1074. string-set! (basic subroutine)
  1075.     (string-set! s i c)
  1076.         Replaces the i-th character of the string s with the
  1077.         character c. The first character has index 0.
  1078. string<=? string<? string=? string>=? string>? 
  1079.     (defined in siod.scm as autoload-from-file)
  1080.     (op s1 s2)
  1081.         Compares two strings.
  1082. string? (basic subroutine)
  1083.     (string? x)
  1084.         Checks if its arg is a string.
  1085. sub1 (subroutine)
  1086.     (sub1 n)
  1087.         Subtracts 1 from its arg.
  1088. substring (basic subroutine)
  1089.     (substring s i1 i2)
  1090.         Returns a string that contains the part of the string s
  1091.         between i1 and i2-1.
  1092. substring-CI<? substring-CI=? (defined in siod.scm as autoload-from-file)
  1093.     (op s1 i1 i2 s2 i3 i4)
  1094.         Compares the substring of s1 between i1 and i2-1 and the
  1095.         substring of s2 between i3 and i4-1 in a character 
  1096.         insensitive way.
  1097. substring-fill! (defined in siod.scm as autoload-from-file)
  1098.     (substring-fill! s i1 i2 c)
  1099.         Replaces all the characters in the string s between i1 and
  1100.         i2-1 with the character c.
  1101. substring-find-next-char-in-set substring-find-previous-char-in-set 
  1102.     (op s1 i1 i2 c)
  1103.     (op s1 i1 i2 s2)
  1104.         Searches, in the substring of s1 between i1 and i2, the 
  1105.         first occurrence of the char c or of one of the characters 
  1106.         of the string s2. The first procedure searches starting 
  1107.         from i1 to i2 and the second from i2 to i1.
  1108. substring-move-left! substring-move-right! 
  1109.     (defined in siod.scm as autoload-from-file)
  1110.     (op s1 i1 i2 s2 i3)
  1111.         Copies the substring of s1 between i1 and i2-1 to s2
  1112.         starting at position i3. The first starts copying from the
  1113.         left to the rigth and the second from the rigth to the
  1114.         left. If s1 and s2 are different strings there is no 
  1115.         difference between the two procedures but if the string is
  1116.         the same and the indexes are overlapping the behaviour can
  1117.         be different. 
  1118. substring<? substring=? (defined in siod.scm as autoload-from-file)
  1119.     (op s1 i1 i2 s2 i3 i4)
  1120.         Compares the substring of s1 between i1 and i2-1 and the
  1121.         substring of s2 between i3 and i4-1.
  1122. symbol->ascii (subroutine)
  1123.     (symbol->ascii y)
  1124.         Returns the ascii code correspondent to the first character
  1125.         in the printed representation of the symbol.
  1126. symbol->string (subroutine)
  1127.     (symbol->string y)
  1128.         Returns a string containing the written representation of
  1129.         the symbol y.
  1130. symbol? (basic subroutine)
  1131.     (symbol? x)
  1132.         Checks if its arg is a symbol.
  1133. t (constant)
  1134.     t
  1135.         initialized to the value #t
  1136. true (constant)
  1137.     true
  1138.         initialized to the value #t
  1139. tail (defined in siod.scm as autoload-from-file)
  1140.     (tail stream)
  1141.         Forces the evaluation and returns the tail component of a
  1142.         stream. This component is memoized.
  1143. tan (basic subroutine)
  1144.         (tan n)
  1145.                 returns the tangent of a number.
  1146. thaw (defined in siod.scm as autoload-from-file)
  1147.     (thaw o)
  1148.         Forces the evaluation of a thunk. Not memoized.
  1149. the-empty-stream (defined in siod.scm as autoload-from-file)
  1150.     the-empty-stream
  1151.         is a stream representing the end-of-stream tag.
  1152. the-environment (basic subroutine)
  1153.     (the-environment)
  1154.         Returns the current environment.
  1155. transcript-off (subroutine)
  1156.     (transcript-off)
  1157.         Terminates the recording of all the console i/o to the
  1158.         transcript file and closes it. 
  1159.         Non standard feature: returns #f if the transcript mode is
  1160.         already off otherwise #t.
  1161. transcript-on (subroutine)
  1162.     (transcript-on s)
  1163.         Opens a file named s and starts recording all the console
  1164.         i/o to that file.
  1165. truncate (basic subroutine)
  1166.     (truncate n)
  1167.         Returns the integer component of a number.
  1168. unbound? (subroutine)
  1169.     (unbound? y {e})
  1170.         Returns #t if the symbol y is not bound in the environment
  1171.         e. If e is omitted the current environment is used instead.
  1172. unquote (subroutine)
  1173.     (unquote <exp>)
  1174.     ,<exp>
  1175.         Is valid only inside a quasiquote expression. Cause the exp
  1176.         to be evaluated and the result is inserted in the
  1177.         quasiquote expression instead of the unquote expression.
  1178. unquote-splicing (subroutine)
  1179.     (unquote-splicing <exp>)
  1180.     ,@<exp>
  1181.         Is valid only inside a quasiquote expression. Cause the exp
  1182.         to be evaluated (it must evaluae to a list) and the result 
  1183.         is inserted in the quasiquote expression instead of the 
  1184.         unquote-splicing expression stripping away the parenthesis.
  1185. user-global-environment (constant)
  1186.     user-global-environment
  1187.         To this variable is bound the global environment whose
  1188.         bindings cannot be examinated.
  1189. user-initial-environment (constant)
  1190.     user-initial-environment
  1191.         In this environment are evaluated and defined the user
  1192.         procedures and commands.
  1193. vector (basic subroutine)
  1194.     (vector x ...)
  1195.         Returns a vector containing its args.
  1196. vector->list (subroutine)
  1197.     (vector->list v)
  1198.         Returns a list containing the same elements of the vector.
  1199. vector-fill! (subroutine)
  1200.     (vector-fill! v x)
  1201.         Replaces each element of v with the value of x.
  1202. vector-length (basic subroutine)
  1203.     (vector-length v)
  1204.         Returns the length of v.
  1205. vector-ref (basic subroutine)
  1206.     (vector-ref v i)
  1207.         Returns the i-th element of a vector. The first element of
  1208.         the vector has index 0.
  1209. vector-set! (basic subroutine)
  1210.     (vector-set! v i x)
  1211.         Sets the i-th element of a vector to the value of x. The 
  1212.         first element of the vector has index 0.
  1213. vector? (basic subroutine)
  1214.     (vector? x)
  1215.         Checks if its arg is a vector.
  1216. when (subroutine)
  1217.     (when <pred> <exp> ...)
  1218.         Evaluates pred if its value is #t evaluates all the 
  1219.         expression.
  1220. with-input-from-file with-output-to-file 
  1221.     (defined in siod.scm as autoload-from-file)
  1222.     (op s o)
  1223.         o is a thunk a procedure of no arguments. These procedures
  1224.         opens a file named s, replaces the current input or output
  1225.         port with this file and then invokes o. The file s is
  1226.         always closed and the current port restored. In Siod if you
  1227.         exit from o with an escape mechanism (call/cc or *thaw)
  1228.         this happens only at the first reset or error.
  1229. write (subroutine)
  1230.     (write x {p})
  1231.         Writes an expression to a port. The expression is written
  1232.         in such a way that if re-read into scheme using read will 
  1233.         produce the same object. Strings are enclosed in " and
  1234.         eventually slashed, symbols are slashed if necesary,
  1235.         characters are preceeded by a #\, objects like ports,
  1236.         environment, procedures, closures, etc that can not be
  1237.         re-read into scheme prints a #<name> where name is the name
  1238.         of the object. To convey some information to the user write
  1239.         prints also the type of procedures and the number of 
  1240.         arguments needed to a closure. Types of procedures are:
  1241.                             0 a procedure with 0 args
  1242.                             1 a procedure with 1 args
  1243.                             2 a procedure with 2 args
  1244.                             3 a procedure with 3 args
  1245.                             4 a procedure with more than 3
  1246.                             5 a special form
  1247.                             6 a special form
  1248. write-char (subroutine)
  1249.         (write-char c {p})
  1250.                 writes a character to a port. If p is omitted the current
  1251.                 output port is used.
  1252. writeln (basic subroutine)
  1253.         (writeln x ... )
  1254.                 writes a list of objects to the current output port using
  1255.                 display.
  1256. zero? (subroutine)
  1257.         (zero? n)
  1258.                 checks if n is zero.
  1259.  
  1260. LANGUAGE EXTENSIONS, SYSTEM AND USER PACKAGES (non standard)
  1261.  
  1262. *cargs* (variable)
  1263.     *cargs*
  1264.         Inside a breakpoint it evaluates to the current stack
  1265.         frame.
  1266. *catch (subroutine)
  1267.     (*catch x <exp> ...)
  1268.         Sets a jump point of tag x, evaluates each exp and then
  1269.         removes the jump point. When a *throw jumps to the jump
  1270.         point removes all the jump points that have been set after
  1271.         it.
  1272. *cenv* (variable)
  1273.     *cenv*
  1274.         Inside a breakpoint it evaluates to the environment in 
  1275.         effect when the breakpoint was entered.
  1276. *error* (basic subroutine)
  1277.     (*error*)
  1278.         This is the default error handler. It flushes all the output
  1279.         port, checks the current input or output ports and
  1280.         eventually replaces them with the standard ports, prints the
  1281.         error message and if the variable sym_debug_mode is #t 
  1282.         invokes the inspector.
  1283.         When an error occours Siod sets the variables errobj
  1284.         *lasterr* *cenv* *cargs* and invokes *error*, when it
  1285.         returns siod sets the variables *cenv* and *cargs* to nil
  1286.         (they can point to very large an often useless structures 
  1287.         and the gc cannot deallocate them until something points to
  1288.         them) and performs a reset.
  1289. *lasterr* (variable)
  1290.     *lasterr*
  1291.         The last error message is bound by the system to this
  1292.         variable.
  1293. *on-reset* (variable)
  1294.     *on-reset*
  1295.         This variable is evaluated each time a reset is performed
  1296.                 in the file siod.scm is initialized to the reset-handler
  1297.         contained in *on-reset-env*.
  1298. *on-reset-env* (constant)
  1299.     *on-reset-env*
  1300.         Contains a stack of thunks, procedures of 0 args that will
  1301.         be evaluated at the first reset. When a reset occours the
  1302.         first thunk is removed from the stack and then evaluated and
  1303.         so on until the stack is empty. Can be used by the user to
  1304.         intercept errors and resets. Each thunk is evaluated once.
  1305. *throw (subroutine)
  1306.     (*throw x1 x2)
  1307.         Jumps to the jump point marked by the tag x1, the value x2
  1308.         is returned by the corresponding *catch. All the jump
  1309.         points set after this are removed.
  1310. *tracer* (defined in siod.scm as autoload-from-file)
  1311.     (*tracer* s e)
  1312.         Used by the trace procedure.
  1313. 1st 2nd 3rd 4th (defined in siod.scm as autoload-from-file)
  1314.     (op l)
  1315.         The same as car cadr caddr cadddr respectively.
  1316. bkpt (subroutine)
  1317.     (bkpt s x ...)
  1318.         Enters a breakpoint, sets the variables *cenv* *cargs* to
  1319.         the current stack frame and environment sets the errobj to
  1320.         the x's, prints s and all the x and invokes the standard 
  1321.         inspector.
  1322. break (defined in siod.scm as autoload-from-file)
  1323.     (break o {s})
  1324.         This is a debugging utility. o is a procedure, break modify 
  1325.         its code so that every time the procedure is entered the 
  1326.         optional string s is printed and a breakpoint entered. If
  1327.         the breakpoint ever returns the evaluation restarts 
  1328.         executing the body of the procedure. The break point is 
  1329.         entered after the environment has been extended with the 
  1330.         arguments.
  1331. call-on-reset (defined in siod.scm)
  1332.     (call-on-reset o)
  1333.         Adds the thunk o to the stack of thunks that will be
  1334.         executed at the next reset.
  1335. char-cmp (basic subroutine)
  1336.     (char-cmp c1 c2)
  1337.         Compares two characters. Returns 0 if c1=c2, a negative
  1338.         value if c1<c2, a positive value if c1>c2.
  1339. char-digit? char-lower-case? char-upper-case? 
  1340.     (defined in siod.scm as autoload-from-file)
  1341.     (op c)
  1342.         Checks if its arg is a character representing a digit, a
  1343.         lowercase letter or an uppercase letter respectively.
  1344. close-port (basic subroutine)
  1345.     (close-port p)
  1346.         Closes a port.
  1347. compose (defined in siod.scm)
  1348.     (compose o1 o2)
  1349.         Returns a procedure that is the equivalent of (o2 (o1 ..)).
  1350. cxr (subroutine)
  1351.     (cxr s l)
  1352.         Performs a series of car and cdr on the list l as specified
  1353.         by the string s, read from rigth to left. Every a
  1354.         corresponds to a car and every d to a cdr.
  1355. cycle (defined in siod.scm)
  1356.     (cycle <exp>)
  1357.         Evaluates indefinitely <exp>.
  1358. flush-port (subroutine)
  1359.     (flush-port p)
  1360.         Performs a fflush and a clearerr on the file pointer
  1361.         associated to the port.
  1362. for (defined in siod.scm)
  1363.     (for y <exp1> <exp2> <pred> 
  1364.              <exp3> ...)
  1365.         Extends the environment binding the symbol y to the value
  1366.         of exp1 then evaluates the pred if its value is #t returns
  1367.         otherwise evaluates the other exps and then evaluates exp2,
  1368.         binds the symbol y to its value and evaluates back the 
  1369.         pred.
  1370. gc-status (subroutine)
  1371.     (gc-status)
  1372.         Prints some informations on the system variables, the
  1373.         number of cons available, the number of buckets of the
  1374.         symbol table used and calculates the loading factor of the
  1375.         table.
  1376. nth (defined in siod.scm)
  1377.     (nth l i)
  1378.         The same as list-ref.
  1379. open-port (basic subroutine)
  1380.     (open-port s1 s2 i)
  1381.         Return a port associated with the file named s1. s2
  1382.         represents the open mode following the C-language
  1383.         convensions: "r" open a file in read mode, "w" open a file
  1384.         in write mode, "a" open a file in append mode, if a "+" is
  1385.         specified in the string the file is opened in read/write 
  1386.         mode and if a "b" is specified opens a binary file. If a
  1387.         file is opened in read/write mode, following the C-language
  1388.         convensions between a read and a write operation a fflush
  1389.         (flush-port in siod) should be performed. i specifies the
  1390.         bufferization of the file, if its value is positive a full
  1391.         bufferization is used with a 512 bytes buffer, if its value
  1392.         is negative a line bufferization is used and if is 0 the
  1393.         file is unbuffered.
  1394. procedure-code (subroutine)
  1395.     (procedure-code o)
  1396.         Returns the procedure code of o. The procedure code is a
  1397.         pair whose car is the arg-list and the cdr the body.
  1398. quit (basic subroutine)
  1399.     (quit)
  1400.         Exits siod.
  1401. repeat (defined in siod.scm)
  1402.     (repeat <exp> <pred>)
  1403.         Evaluates the exp and then the pred if its value is #t
  1404.         returns otherwise evaluates back th exp.
  1405. set-procedure-code! (subroutine)
  1406.     (set-procedure-code! o l)
  1407.         Replaces the procedure code of o with l. Must be used
  1408.         carefully. The procedure code is a pair whose car is
  1409.         the arg-list and the cdr the body.
  1410. siod-debug-mode (variable)
  1411.     siod-debug-mode
  1412.         If set to #t the inspector is invoked after each error.
  1413. siod-gc-mode (variable)
  1414.     siod-gc-mode
  1415.         If set to #t before and after each gc a message is printed.
  1416. siod-repl-mode (variable)
  1417.     siod-repl-mode
  1418.         If set to #t after the evaluation of each command some
  1419.         informations on the timing and the memory usage are printed.
  1420. stream-append (defined in siod.scm as autoload-from-file)
  1421.     (stream-append stream1 stream2)
  1422.         Returns a stream obtained concatenating stream1 and
  1423.         stream2.
  1424. stream-filter (defined in siod.scm as autoload-from-file)
  1425.     (stream-filter <pred> stream)
  1426.         Applies the pred to all the elements of a finite stream and
  1427.         returns a stream of that elements for which the result of
  1428.         the pred was #t.
  1429. stream-for-each (defined in siod.scm as autoload-from-file)
  1430.     (stream-map o stream)
  1431.         Applies the procedure o to all the elements of a finite 
  1432.         stream.
  1433. stream-map (defined in siod.scm as autoload-from-file)
  1434.     (stream-map o stream)
  1435.         Applies the procedure o to all the elements of a finite 
  1436.         stream returning a stream of the results.
  1437. stream-nth (defined in siod.scm as autoload-from-file)
  1438.     (stream-nth i stream)
  1439.         The same as stream-ref.
  1440. stream-ref (defined in siod.scm as autoload-from-file)
  1441.     (stream-ref i stream)
  1442.         Returns the i-th component of a stream.
  1443. string-cmp (basic subroutine)
  1444.     (string-cmp s1 s2)
  1445.         Compares two strings. The result is 0 if s1=s2, is positive
  1446.         if s1>s2, negative if s1<s2.
  1447. string-cmp-ci (subroutine)
  1448.     (string-cmp-ci s1 s2)
  1449.         Compares two strings in a case insensitive way. The result 
  1450.         is 0 if s1=s2, is positive if s1>s2, negative if s1<s2.
  1451. time-of-day (defined in siod.scm)
  1452.     (time-of-day)
  1453.         The same as runtime.
  1454. trace (defined in siod.scm as autoload-from-file)
  1455.     (trace o {s})
  1456.         This is a debugging utility o is a procedure, trace modify 
  1457.         its code so that every time the procedure is entered the 
  1458.         optional string s or the string "entering procedure " is
  1459.         printed and the contents of the last environment frame (the
  1460.         one that contains the argument bindings) is listed. Then 
  1461.         the execution restarts.
  1462. unbreak (defined in siod.scm as autoload-from-file)
  1463.     (unbreak o)
  1464.         Removes the break informations from o.
  1465. uncall-on-reset (defined in siod.scm)
  1466.     (uncall-on-reset o)
  1467.         Removes the thunk o from the stack of thunks that will be
  1468.         executed at the next reset using delq!.
  1469. untrace (defined in siod.scm as autoload-from-file)
  1470.     (untrace o)
  1471.         Removes the break informations from o.
  1472. vector-append (defined in siod.scm as autoload-from-file)
  1473.     (vector-append v1 v2)
  1474.         Returns a vector containing all the elements of v1 and v2.
  1475. vector-copy (defined in siod.scm as autoload-from-file)
  1476.     (vector-copy v)
  1477.         Returns a vector containing all the elements of v.
  1478. vector-for-each (defined in siod.scm as autoload-from-file)
  1479.     (vector-for-each v o)
  1480.         Applies the procedure o to all the elements of v.
  1481. vector-map (defined in siod.scm as autoload-from-file)
  1482.     (vector-map v o)
  1483.         Applies the procedure o to all the elements of v and
  1484.         returns avector of the results.
  1485. vector-reverse (defined in siod.scm as autoload-from-file)
  1486.     (vector-reverse v)
  1487.         Returns a vector containing the same elements as v but in
  1488.         reverse order.
  1489. vector-reverse! (defined in siod.scm as autoload-from-file)
  1490.     (vector-reverse! v)
  1491.         Destructively reverse the order of the elements of v.
  1492. while (subroutine)
  1493.     (while <pred> <exp> ...)
  1494.         Evaluates pred and if its alue is #t evaluates the exps and
  1495.         then evaluates back the pred.
  1496.